<template>
   <div style="width:420px;height:250px" ref="chart"></div>
</template>

<script>
import * as echarts from 'echarts'
export default {
    mounted(){
       let chart=echarts.init(this.$refs.chart)
       let options={
         xAxis:{
            data:['1月份','2月份','3月份','4月份','5月份','6月份']
         },
         yAxis:{},
         series:[
            {
                type:'bar',
                data:[897,788,234,455,566,789],
                markPoint:{
                    data:[
                        {name:'最大值',type:'max'},
                        {name:'最小值',type:'min'}
                    ]
                },
                markLine:{
                    data:[
                        {name:'平均销售量',type:'average'}
                    ]
                },
                label:{
                    show:true,
                    // position:'top',
                    rotate:30,
                    color:'#f00',
                    backgroundColor:'#ff0'
                },
                itemStyle:{
                    color:'orange',
                    shadowBlur:15,
                    opacity:.5,
                    shadowOffsetX:15
                },
                barWidth:15
            }
         ]
       }
       chart.setOption(options)
    }
}
</script>

<style>

</style>